babl.git
9 years agobabl-cache: avoid %'ing by 0
Øyvind Kolås [Sun, 20 Nov 2016 12:28:43 +0000 (13:28 +0100)]
babl-cache: avoid %'ing by 0

9 years agobabl-verify: set a high tolerance, avoid censoring some underperforming fast paths
Øyvind Kolås [Sun, 20 Nov 2016 11:36:36 +0000 (12:36 +0100)]
babl-verify: set a high tolerance, avoid censoring some underperforming fast paths

9 years agotwo-table: add RGBA float to R'G'B'A u8
Øyvind Kolås [Sat, 19 Nov 2016 19:08:28 +0000 (20:08 +0100)]
two-table: add RGBA float to R'G'B'A u8

9 years agofast-float: add RGBA float to R'G'B'A u8
Øyvind Kolås [Sat, 19 Nov 2016 19:08:16 +0000 (20:08 +0100)]
fast-float: add RGBA float to R'G'B'A u8

9 years agomake pow implementations inlineable - gaining some fixed amount of blitting performance
Øyvind Kolås [Sat, 19 Nov 2016 17:27:06 +0000 (18:27 +0100)]
make pow implementations inlineable - gaining some fixed amount of blitting performance

9 years agofast-float: fix regression introduced when reindenting
Øyvind Kolås [Sat, 19 Nov 2016 18:38:14 +0000 (19:38 +0100)]
fast-float: fix regression introduced when reindenting

9 years agoremove babl-fish-stats
Øyvind Kolås [Sat, 19 Nov 2016 18:22:10 +0000 (19:22 +0100)]
remove babl-fish-stats

9 years agogegl-fixups: indentation
Øyvind Kolås [Sat, 19 Nov 2016 17:50:27 +0000 (18:50 +0100)]
gegl-fixups: indentation

9 years agofast-float: indentation
Øyvind Kolås [Sat, 19 Nov 2016 17:50:11 +0000 (18:50 +0100)]
fast-float: indentation

9 years agoremove bablfishpath
Øyvind Kolås [Sat, 19 Nov 2016 17:14:11 +0000 (18:14 +0100)]
remove bablfishpath

9 years agocairo: reorder memory reads to be linear
Øyvind Kolås [Sat, 19 Nov 2016 14:29:48 +0000 (15:29 +0100)]
cairo: reorder memory reads to be linear

9 years agofast-float: improve memory access order
Øyvind Kolås [Sat, 19 Nov 2016 14:21:20 +0000 (15:21 +0100)]
fast-float: improve memory access order

9 years agoremove babl_process_cost
Øyvind Kolås [Sat, 19 Nov 2016 14:01:14 +0000 (15:01 +0100)]
remove babl_process_cost

9 years agoextension/fast-float: gain some speed by ignoring a couple high mantissa bits
Øyvind Kolås [Sat, 19 Nov 2016 12:29:36 +0000 (13:29 +0100)]
extension/fast-float: gain some speed by ignoring a couple high mantissa bits

9 years agoextensions/cairo: remove ; now unused; LUT
Øyvind Kolås [Sat, 19 Nov 2016 12:28:35 +0000 (13:28 +0100)]
extensions/cairo: remove ; now unused; LUT

9 years agofast-float: make float to cairo conversion take clipping into account
Øyvind Kolås [Sat, 19 Nov 2016 11:07:40 +0000 (12:07 +0100)]
fast-float: make float to cairo conversion take clipping into account

9 years agobabl-fish-path: add some specific conversion targeted debug info
Øyvind Kolås [Wed, 16 Nov 2016 19:34:05 +0000 (20:34 +0100)]
babl-fish-path: add some specific conversion targeted debug info

9 years agotools: add babl-verify start of an development aid when improving fast paths
Øyvind Kolås [Wed, 16 Nov 2016 19:40:58 +0000 (20:40 +0100)]
tools: add babl-verify start of an development aid when improving fast paths

This tool take the names of source/target formats - and prints error/cost for
all direct conversions matching arguments.

9 years agofast-float: implement linear interpolation in LUT
Øyvind Kolås [Fri, 18 Nov 2016 22:38:12 +0000 (23:38 +0100)]
fast-float: implement linear interpolation in LUT

9 years agoextensions/gggl-lies: bump up accuracy of a conversion
Øyvind Kolås [Thu, 17 Nov 2016 12:09:54 +0000 (13:09 +0100)]
extensions/gggl-lies: bump up accuracy of a conversion

9 years agofast-float: use higher accuracy LUTs and rework some alpha handling
Øyvind Kolås [Wed, 16 Nov 2016 21:39:17 +0000 (22:39 +0100)]
fast-float: use higher accuracy LUTs and rework some alpha handling

9 years agocairo: pad with 255 instead of copy of color for 24bit format
Øyvind Kolås [Wed, 16 Nov 2016 22:52:26 +0000 (23:52 +0100)]
cairo: pad with 255 instead of copy of color for 24bit format

9 years agocairo: slight improvements to speed and accuracy
Øyvind Kolås [Wed, 16 Nov 2016 22:19:46 +0000 (23:19 +0100)]
cairo: slight improvements to speed and accuracy

9 years agoextensions/cairo: remove some arithmetic
Øyvind Kolås [Wed, 16 Nov 2016 22:11:15 +0000 (23:11 +0100)]
extensions/cairo: remove some arithmetic

9 years agochange default BABL_TOLERANCE to 0.000006
Øyvind Kolås [Wed, 16 Nov 2016 19:36:57 +0000 (20:36 +0100)]
change default BABL_TOLERANCE to 0.000006

This makes the cairo.so extensions fast path for RGBA float blitting to be
accepted. This makes conversions with internal quantization of roughly 16bit be
accepted.

9 years agoextensions/cairo: replace hard-coded LUT with runtime LUT
Øyvind Kolås [Wed, 16 Nov 2016 18:27:28 +0000 (19:27 +0100)]
extensions/cairo: replace hard-coded LUT with runtime LUT

The LUT needed recomputation anyways, doing it at runtime permits easier
tweaking. This results in better precision for the fast path than the
existing table.

9 years agoadd single precision versions of linear/gamma conversions
Øyvind Kolås [Wed, 16 Nov 2016 16:42:33 +0000 (17:42 +0100)]
add single precision versions of linear/gamma conversions

9 years agofast-float: tweak lut generation
Øyvind Kolås [Wed, 16 Nov 2016 16:12:50 +0000 (17:12 +0100)]
fast-float: tweak lut generation

9 years agobabl-cache: attempt to make things barely compile on win32
Øyvind Kolås [Tue, 15 Nov 2016 22:51:44 +0000 (23:51 +0100)]
babl-cache: attempt to make things barely compile on win32

9 years agostore cached fishes in ~/.cache/babl
Øyvind Kolås [Tue, 15 Nov 2016 16:02:10 +0000 (17:02 +0100)]
store cached fishes in ~/.cache/babl

Still no fish cache path solution for win32

9 years agobabl-cache: remove unneeded switch
Øyvind Kolås [Tue, 15 Nov 2016 14:50:52 +0000 (15:50 +0100)]
babl-cache: remove unneeded switch

9 years agoreduce default max babl path to 3
Øyvind Kolås [Tue, 15 Nov 2016 14:47:58 +0000 (15:47 +0100)]
reduce default max babl path to 3

Big decrease in combinatorial explosion of search - missing out on some big
fish.

9 years agobabl-cache: add a 1% probability of cached conversions being dropped on load
Øyvind Kolås [Tue, 15 Nov 2016 13:50:01 +0000 (14:50 +0100)]
babl-cache: add a 1% probability of cached conversions being dropped on load

9 years agobabl-cache: store tolerance as part of cache versioning
Øyvind Kolås [Tue, 15 Nov 2016 13:22:48 +0000 (14:22 +0100)]
babl-cache: store tolerance as part of cache versioning

9 years agomove fish cache to own .c file
Øyvind Kolås [Tue, 15 Nov 2016 12:05:28 +0000 (13:05 +0100)]
move fish cache to own .c file

9 years agoextensions: align rounding of R'G'B'A u8 -> cairo-ARGB32 with reference conversion
Simon Budig [Tue, 15 Nov 2016 01:34:27 +0000 (02:34 +0100)]
extensions: align rounding of R'G'B'A u8 -> cairo-ARGB32 with reference conversion

9 years agoAdd extension with HCY color model, and pixel formats
SBP [Fri, 11 Nov 2016 23:14:38 +0000 (17:14 -0600)]
Add extension with HCY color model, and pixel formats

9 years agobabl.db: do not use strtod - it is locale dependent
Øyvind Kolås [Mon, 14 Nov 2016 23:33:41 +0000 (00:33 +0100)]
babl.db: do not use strtod - it is locale dependent

9 years agoremove deprecated loss struct member
Øyvind Kolås [Mon, 14 Nov 2016 21:09:00 +0000 (22:09 +0100)]
remove deprecated loss struct member

9 years agobabl.db: if git hash has changed, drop cache
Øyvind Kolås [Mon, 14 Nov 2016 19:47:39 +0000 (20:47 +0100)]
babl.db: if git hash has changed, drop cache

9 years agobabl.db: store git rev/version in header
Øyvind Kolås [Mon, 14 Nov 2016 19:42:16 +0000 (20:42 +0100)]
babl.db: store git rev/version in header

9 years agobuild: add generation of git-version.h
Øyvind Kolås [Mon, 14 Nov 2016 17:01:55 +0000 (18:01 +0100)]
build: add generation of git-version.h

9 years agofish cache: sort cached fish paths by descending usage
Øyvind Kolås [Mon, 14 Nov 2016 17:39:16 +0000 (18:39 +0100)]
fish cache: sort cached fish paths by descending usage

9 years agobabl-fish-path: do not allow parallell construction
Øyvind Kolås [Mon, 14 Nov 2016 16:18:36 +0000 (17:18 +0100)]
babl-fish-path: do not allow parallell construction

9 years agobabl_init_db: formats being with first char of line
Øyvind Kolås [Mon, 14 Nov 2016 13:28:31 +0000 (14:28 +0100)]
babl_init_db: formats being with first char of line

9 years agobail on db-cache restoration if format lookup fails
Øyvind Kolås [Mon, 14 Nov 2016 01:30:03 +0000 (02:30 +0100)]
bail on db-cache restoration if format lookup fails

9 years agobabl: cache state between babl runs
Øyvind Kolås [Sun, 13 Nov 2016 23:45:15 +0000 (00:45 +0100)]
babl: cache state between babl runs

Store the contents of discovered babl_paths between runs, for now in
/tmp/babl.db , should move to a per-user dir to make it survive reboots.

The code should also check a versioning string at the start and bail if there
is any mismatch... since the data should be reconstructable; and more reliable
when reconstructed than a possibly old version.

9 years agoPost-release version bump to 0.1.21
Alexandre Prokoudine [Sat, 5 Nov 2016 17:22:41 +0000 (20:22 +0300)]
Post-release version bump to 0.1.21

9 years agoRelease 0.1.20
Alexandre Prokoudine [Sat, 5 Nov 2016 17:14:55 +0000 (20:14 +0300)]
Release 0.1.20

9 years agoUpdate NEWS for 0.1.20
Alexandre Prokoudine [Sat, 5 Nov 2016 17:12:12 +0000 (20:12 +0300)]
Update NEWS for 0.1.20

9 years agoextensions: fast-float: add destroy() callback, fix 2 leaks
Roman Lebedev [Mon, 22 Aug 2016 17:24:14 +0000 (20:24 +0300)]
extensions: fast-float: add destroy() callback, fix 2 leaks

Fixes these 2 not-so-informative leaks, every test showed them:

=================================================================
==27868==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 540276 byte(s) in 1 object(s) allocated from:
    0 0x4cf190 in calloc (/home/lebedevri/src/_GIMP/babl/tests/.libs/nop+0x4cf190)
    1 0x7f9cdd208cbb  (<unknown module>)
    2 0x7f9cdd207cca  (<unknown module>)
    3 0x7f9ce06820d8 in babl_extension_load /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:221:7
    4 0x7f9ce06819d6 in babl_extension_load_dir /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:263:19
    5 0x7f9ce06813fa in babl_extension_load_dir_list /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:333:17
    6 0x7f9ce0678c84 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:151:7
    7 0x50504a in main /home/lebedevri/src/_GIMP/babl/tests/nop.c:26:3
    8 0x7f9cdf64e72f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2072f)

Direct leak of 540276 byte(s) in 1 object(s) allocated from:
    0 0x4cf190 in calloc (/home/lebedevri/src/_GIMP/babl/tests/.libs/nop+0x4cf190)
    1 0x7f9cdd208cbb  (<unknown module>)
    2 0x7f9cdd207cf6  (<unknown module>)
    3 0x7f9ce06820d8 in babl_extension_load /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:221:7
    4 0x7f9ce06819d6 in babl_extension_load_dir /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:263:19
    5 0x7f9ce06813fa in babl_extension_load_dir_list /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:333:17
    6 0x7f9ce0678c84 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:151:7
    #7 0x50504a in main /home/lebedevri/src/_GIMP/babl/tests/nop.c:26:3
    8 0x7f9cdf64e72f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2072f)

SUMMARY: AddressSanitizer: 1080552 byte(s) leaked in 2 allocation(s).

9 years agobabl-extension: fix BABL_PATH debug warning
Øyvind Kolås [Tue, 30 Aug 2016 22:32:02 +0000 (00:32 +0200)]
babl-extension: fix BABL_PATH debug warning

9 years agobabl-extension: print warning if no extensions were loaded
Øyvind Kolås [Tue, 30 Aug 2016 22:17:24 +0000 (00:17 +0200)]
babl-extension: print warning if no extensions were loaded

9 years agobabl_fish_path_fitness: gcc6: fix -Wmisleading-indentation warnings
Roman Lebedev [Fri, 26 Aug 2016 10:16:51 +0000 (13:16 +0300)]
babl_fish_path_fitness: gcc6: fix -Wmisleading-indentation warnings

9 years agotools: babl-gen-test-pixels: add explicit return 0
Roman Lebedev [Mon, 22 Aug 2016 12:25:31 +0000 (15:25 +0300)]
tools: babl-gen-test-pixels: add explicit return 0

Gcc-4.9 warns:
babl-gen-test-pixels.c: In function ‘main’:
babl-gen-test-pixels.c:170:1: error: control reaches end of non-void function [-Werror=return-type]

9 years agoextensions: gegl-fixups: mark unused functions with attribute
Roman Lebedev [Sun, 21 Aug 2016 11:08:37 +0000 (14:08 +0300)]
extensions: gegl-fixups: mark unused functions with attribute

9 years agoBabl-fish-reference: create_name_internal(): ooops, should return int
Roman Lebedev [Sun, 21 Aug 2016 08:49:26 +0000 (11:49 +0300)]
Babl-fish-reference: create_name_internal(): ooops, should return int

I broke it in 0fe22e1e37197ef6112645bf5a136580c0927a1e
and totally did not even notice the warning...

9 years agoextensions: gggl: conv_rgb8_rgba8(): use 255UL, not 255
Roman Lebedev [Fri, 19 Aug 2016 17:05:17 +0000 (20:05 +0300)]
extensions: gggl: conv_rgb8_rgba8(): use 255UL, not 255

Fixes:
gggl.c:758:62: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'

9 years agoextensions: fast-float: babl_lookup(): use 1UL, not just 1
Roman Lebedev [Fri, 19 Aug 2016 17:04:59 +0000 (20:04 +0300)]
extensions: fast-float: babl_lookup(): use 1UL, not just 1

Fixes:

fast-float.c:81:35: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
and
fast-float.c:91:34: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

9 years agobabl_fish_reference(), create_name(): add conditional fastpath.
Roman Lebedev [Fri, 19 Aug 2016 12:23:02 +0000 (15:23 +0300)]
babl_fish_reference(), create_name(): add conditional fastpath.

Using __thread keyword.
Although, it is probably not universally avaliable, so this
is just conditional fastpath, if it is detected as unsupported
at compile time, the dumb implementation using malloc() is used.

9 years agobabl_fish_reference(), create_name() are racy
Roman Lebedev [Fri, 19 Aug 2016 18:01:03 +0000 (21:01 +0300)]
babl_fish_reference(), create_name() are racy

create_name_internal() uses global static buffer to create name.
While this is definitely fast, it can't work concurrently.

I used snprintf()+malloc()+snprintf(), so the amount of allocated
memory for the string is optimal.

Alternatively, a mutex would solve the problem, not sure which
solution is faster / better.

9 years agoAdd .kateconfig with modelines for Kate
Roman Lebedev [Thu, 18 Aug 2016 11:01:51 +0000 (14:01 +0300)]
Add .kateconfig with modelines for Kate

Directly follows GIMP HACKING Hackordnung:
  - 2 characters indentation level
  - no tabs. TAB should not put TAB characters in the file.
  - tab stops at 8 column intervals.

9 years agopost release version bump to 0.1.19
Øyvind Kolås [Wed, 15 Jun 2016 05:20:36 +0000 (07:20 +0200)]
post release version bump to 0.1.19

9 years agoRelease 0.1.18
Alexandre Prokoudine [Sun, 12 Jun 2016 23:07:53 +0000 (02:07 +0300)]
Release 0.1.18

9 years agoBug 764628: Gaussian blur: visual glitches
Massimo Valentini [Mon, 30 May 2016 10:45:44 +0000 (12:45 +0200)]
Bug 764628: Gaussian blur: visual glitches

10 years agopost release bump
Øyvind Kolås [Fri, 12 Feb 2016 14:27:10 +0000 (15:27 +0100)]
post release bump

10 years agorelease 0.0.16
Øyvind Kolås [Fri, 12 Feb 2016 14:25:42 +0000 (15:25 +0100)]
release 0.0.16

10 years agoextensions: re-add table based conversions inherited from gggl
Øyvind Kolås [Fri, 12 Feb 2016 11:05:33 +0000 (12:05 +0100)]
extensions: re-add table based conversions inherited from gggl

This code was replaces with the exact code paths in gggl and gggl-lies,
adding these new extensions re-enables the ability to use these
slightly less exact conversions - that possibly also could be fixed
to be exact.

10 years agozero initialize lsb
Massimo Valentini [Tue, 19 Jan 2016 18:07:19 +0000 (19:07 +0100)]
zero initialize lsb

10 years agoextensions: remove inaccurate table based conversions
Øyvind Kolås [Mon, 18 Jan 2016 22:37:09 +0000 (23:37 +0100)]
extensions: remove inaccurate table based conversions

If desired - the table based fast paths should be re-added as separate
extensions.

10 years agobase: half-float reference zero initialize lsb
Massimo Valentini [Sat, 16 Jan 2016 18:33:25 +0000 (19:33 +0100)]
base: half-float reference zero initialize lsb

10 years agobase: remove commented out single/half code
Øyvind Kolås [Sat, 16 Jan 2016 11:08:06 +0000 (12:08 +0100)]
base: remove commented out single/half code

10 years agoextensions: add single to/from half float extension
Øyvind Kolås [Sat, 16 Jan 2016 11:07:21 +0000 (12:07 +0100)]
extensions: add single to/from half float extension

10 years agobase: fix half reference conversion expecting zeroed target
Øyvind Kolås [Sat, 16 Jan 2016 10:16:22 +0000 (11:16 +0100)]
base: fix half reference conversion expecting zeroed target

As discovered in bug #760703 the reference path is currently expecting
zeroed memory, fix by explicitly zeroing last 32bit of mantissa.

10 years agosse2: reuse linear premul/unpremul for gamma formats
Øyvind Kolås [Sun, 10 Jan 2016 23:42:42 +0000 (00:42 +0100)]
sse2: reuse linear premul/unpremul for gamma formats

10 years agoCIE: Add conversion from "RGB float" to "CIE Lab float" and vice versa
Debarshi Ray [Sat, 9 Jan 2016 18:41:29 +0000 (19:41 +0100)]
CIE: Add conversion from "RGB float" to "CIE Lab float" and vice versa

Conversions from "RGB float" to "CIE Lab float" are 10 times slower
without this. One use case is passing a "RGB float" buffer to a
saturation operation that works in the "CIE Lab" colour space.

https://bugzilla.gnome.org/show_bug.cgi?id=760310

10 years agoFix AVX instructions being generated in SSE4.1 code (bug #760292)
Daniel Sabo [Fri, 8 Jan 2016 02:05:44 +0000 (18:05 -0800)]
Fix AVX instructions being generated in SSE4.1 code (bug #760292)

The half-float flag got accidentally added to the SSE4.1 flags,
causing GCC to auto-enable AVX.

10 years agoextensions: Only build sse-half for x86_64.
Michael Henning [Mon, 4 Jan 2016 00:00:29 +0000 (19:00 -0500)]
extensions: Only build sse-half for x86_64.

_mm_insert_epi64 is only available on 64-bit

10 years agoconfigure.ac: Fix the test for compiling half-floating point code.
Michael Henning [Sun, 3 Jan 2016 22:02:38 +0000 (17:02 -0500)]
configure.ac: Fix the test for compiling half-floating point code.

_mm_cvtph_ps is implicitly defined if the compiler does not support
it. So, we need to store its return value in a variable so that
the test fails to type check when the function is implicitly defined
to return an int.

10 years agoAdd support for hardware half<->float conversions
Daniel Sabo [Sun, 27 Dec 2015 15:29:55 +0000 (07:29 -0800)]
Add support for hardware half<->float conversions

These instructions require a Ivy Bridge or newer processor, so I've only
been able to test them under the Intel Software Development Emulator.

10 years agoAdd SSE4.1 u8 -> float conversions
Daniel Sabo [Sun, 20 Dec 2015 11:14:19 +0000 (03:14 -0800)]
Add SSE4.1 u8 -> float conversions

10 years agoAdd SSE4 to babl-cpuaccel
Daniel Sabo [Sun, 20 Dec 2015 11:36:51 +0000 (03:36 -0800)]
Add SSE4 to babl-cpuaccel

10 years agofix bug 755405
Øyvind Kolås [Sat, 21 Nov 2015 02:44:13 +0000 (03:44 +0100)]
fix bug 755405

10 years agopost release version bump
Øyvind Kolås [Thu, 19 Nov 2015 20:26:04 +0000 (21:26 +0100)]
post release version bump

10 years agorelease: 0.1.14
Øyvind Kolås [Thu, 19 Nov 2015 20:05:17 +0000 (21:05 +0100)]
release: 0.1.14

10 years agoNEWS, AUTHORS: updates
Øyvind Kolås [Thu, 19 Nov 2015 20:05:07 +0000 (21:05 +0100)]
NEWS, AUTHORS: updates

10 years agobabl_format_new(): fix global-buffer-overflow
Roman Lebedev [Sat, 13 Jun 2015 13:59:35 +0000 (16:59 +0300)]
babl_format_new(): fix global-buffer-overflow

If we pass a string into this function, and this string is shorter than
sizeof(Babl), macro BABL_IS_BABL() will read past string bounds,
and bad things may happen.

NOTE: if a string will be passed into this function, that is not
handled by those  if (!strcmp (arg, "<...>")),  global-buffer-overflow
will still happen. i am not sure if/what can be done about it :(

Fixes following error:
=================================================================
==1657==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7fd3026d6c20 at pc 0x7fd3026b6e4a bp 0x7fffaac308a0 sp 0x7fffaac30898
READ of size 4 at 0x7fd3026d6c20 thread T0
    0 0x7fd3026b6e49 in babl_format_new /home/lebedevri/src/_GIMP/babl/babl/babl-format.c:317
    1 0x7fd3026bf44f in construct_double_format /home/lebedevri/src/_GIMP/babl/babl/babl-model.c:259
    2 0x7fd3026bfd12 in babl_model_new /home/lebedevri/src/_GIMP/babl/babl/babl-model.c:204
    3 0x7fd3026acce5 in babl_core_init /home/lebedevri/src/_GIMP/babl/babl/babl-core.c:128
    4 0x7fd3026a9379 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:145
    5 0x7fd306e5a3d1 in gegl_post_parse_hook (/usr/local/lib/libgegl-0.3.so.0+0x523d1)
    6 0x7fd301f5d238 in g_option_context_parse (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55238)
    7 0x7fd301f5e193 in g_option_context_parse_strv (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x56193)
    8 0x48b8cf in main (/usr/local/bin/gimp-2.9+0x48b8cf)
    9 0x7fd300f71b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
    10 0x486b68 (/usr/local/bin/gimp-2.9+0x486b68)

0x7fd3026d6c23 is located 0 bytes to the right of global variable '*.LC8' from 'babl-model.c' (0x7fd3026d6c20) of size 3
  '*.LC8' is ascii string 'id'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/lebedevri/src/_GIMP/babl/babl/babl-format.c:317 babl_format_new
Shadow bytes around the buggy address:
  0x0ffae04d2d70: f9 f9 f9 f9 00 00 04 f9 f9 f9 f9 f9 00 00 02 f9
=>0x0ffae04d2d80: f9 f9 f9 f9[03]f9 f9 f9 f9 f9 f9 f9 00 02 f9 f9
  0x0ffae04d2d90: f9 f9 f9 f9 05 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Contiguous container OOB:fc
  ASan internal:           fe
==1657==ABORTING

10 years agobabl_model_new(): fix global-buffer-overflow
Roman Lebedev [Sat, 13 Jun 2015 13:57:20 +0000 (16:57 +0300)]
babl_model_new(): fix global-buffer-overflow

If we pass a string into this function, and this string is shorter than
sizeof(Babl), macro BABL_IS_BABL() will read past string bounds,
and bad things may happen.

NOTE: if a string will be passed into this function, that is not
handled by those  if (!strcmp (arg, "<...>")),  global-buffer-overflow
will still happen. i am not sure if/what can be done about it :(

Fixes following error:
=================================================================
==31464==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f1c25907940 at pc 0x7f1c258f7636 bp 0x7ffdc4838670 sp 0x7ffdc4838668
READ of size 4 at 0x7f1c25907940 thread T0
    0 0x7f1c258f7635 in babl_model_new /home/lebedevri/src/_GIMP/babl/babl/babl-model.c:114
    1 0x7f1c258e4ce5 in babl_core_init /home/lebedevri/src/_GIMP/babl/babl/babl-core.c:128
    2 0x7f1c258e1379 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:145
    3 0x7f1c2a0923d1 in gegl_post_parse_hook (/usr/local/lib/libgegl-0.3.so.0+0x523d1)
    4 0x7f1c25195238 in g_option_context_parse (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55238)
    5 0x7f1c25196193 in g_option_context_parse_strv (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x56193)
    6 0x48b8cf in main (/usr/local/bin/gimp-2.9+0x48b8cf)
    7 0x7f1c241a9b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
    8 0x486b68 (/usr/local/bin/gimp-2.9+0x486b68)

0x7f1c25907943 is located 0 bytes to the right of global variable '*.LC1' from 'babl-core.c' (0x7f1c25907940) of size 3
  '*.LC1' is ascii string 'id'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/lebedevri/src/_GIMP/babl/babl/babl-model.c:114 babl_model_new
Shadow bytes around the buggy address:
  0x0fe404b18f10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0fe404b18f20: 05 f9 f9 f9 f9 f9 f9 f9[03]f9 f9 f9 f9 f9 f9 f9
  0x0fe404b18f30: 07 f9 f9 f9 f9 f9 f9 f9 07 f9 f9 f9 f9 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Contiguous container OOB:fc
  ASan internal:           fe
==31464==ABORTING

10 years agobabl_component_new(): fix global-buffer-overflow
Roman Lebedev [Sat, 13 Jun 2015 13:54:21 +0000 (16:54 +0300)]
babl_component_new(): fix global-buffer-overflow

If we pass a string into this function, and this string is shorter than
sizeof(Babl), macro BABL_IS_BABL() will read past string bounds,
and bad things may happen.

NOTE: if a string will be passed into this function, that is not
handled by those  if (!strcmp (arg, "<...>")),  global-buffer-overflow
will still happen. i am not sure if/what can be done about it :(

Fixes following error:
=================================================================
==28935==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f6e2393f940 at pc 0x7f6e23919b5f bp 0x7ffc7b9ca770 sp 0x7ffc7b9ca768
READ of size 4 at 0x7f6e2393f940 thread T0
    0 0x7f6e23919b5e in babl_component_new /home/lebedevri/src/_GIMP/babl/babl/babl-component.c:82
    1 0x7f6e2391cbda in babl_core_init /home/lebedevri/src/_GIMP/babl/babl/babl-core.c:96
    2 0x7f6e23919379 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:145
    3 0x7f6e280ca3d1 in gegl_post_parse_hook (/usr/local/lib/libgegl-0.3.so.0+0x523d1)
    4 0x7f6e231cd238 in g_option_context_parse (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55238)
    5 0x7f6e231ce193 in g_option_context_parse_strv (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x56193)
    6 0x48b8cf in main (/usr/local/bin/gimp-2.9+0x48b8cf)
    7 0x7f6e221e1b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
    8 0x486b68 (/usr/local/bin/gimp-2.9+0x486b68)

0x7f6e2393f943 is located 0 bytes to the right of global variable '*.LC1' from 'babl-core.c' (0x7f6e2393f940) of size 3
  '*.LC1' is ascii string 'id'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/lebedevri/src/_GIMP/babl/babl/babl-component.c:82 babl_component_new
Shadow bytes around the buggy address:
  0x0fee4471ff10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0fee4471ff20: 05 f9 f9 f9 f9 f9 f9 f9[03]f9 f9 f9 f9 f9 f9 f9
  0x0fee4471ff30: 07 f9 f9 f9 f9 f9 f9 f9 07 f9 f9 f9 f9 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Contiguous container OOB:fc
  ASan internal:           fe
==28935==ABORTING

10 years agobabl_type_new(): fix global-buffer-overflow
Roman Lebedev [Sat, 13 Jun 2015 13:50:55 +0000 (16:50 +0300)]
babl_type_new(): fix global-buffer-overflow

If we pass a string into this function, and this string is shorter than
sizeof(Babl), macro BABL_IS_BABL() will read past string bounds,
and bad things may happen.

NOTE: if a string will be passed into this function, that is not
handled by those  if (!strcmp (arg, "<...>")),  global-buffer-overflow
will still happen. i am not sure if/what can be done about it :(

Fixes following error:
=================================================================
==25849==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f7faec97940 at pc 0x7f7faec8b9bc bp 0x7ffd22ab9210 sp 0x7ffd22ab9208
READ of size 4 at 0x7f7faec97940 thread T0
    0 0x7f7faec8b9bb in babl_type_new /home/lebedevri/src/_GIMP/babl/babl/babl-type.c:88
    1 0x7f7faec74ba9 in babl_core_init /home/lebedevri/src/_GIMP/babl/babl/babl-core.c:90
    2 0x7f7faec71379 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:145
    3 0x7f7fb342a3d1 in gegl_post_parse_hook (/usr/local/lib/libgegl-0.3.so.0+0x523d1)
    4 0x7f7fae525238 in g_option_context_parse (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55238)
    5 0x7f7fae526193 in g_option_context_parse_strv (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x56193)
    6 0x48b8cf in main (/usr/local/bin/gimp-2.9+0x48b8cf)
    7 0x7f7fad539b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
    8 0x486b68 (/usr/local/bin/gimp-2.9+0x486b68)

0x7f7faec97943 is located 0 bytes to the right of global variable '*.LC1' from 'babl-core.c' (0x7f7faec97940) of size 3
  '*.LC1' is ascii string 'id'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/lebedevri/src/_GIMP/babl/babl/babl-type.c:88 babl_type_new
Shadow bytes around the buggy address:
  0x0ff075d8af10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0ff075d8af20: 05 f9 f9 f9 f9 f9 f9 f9[03]f9 f9 f9 f9 f9 f9 f9
  0x0ff075d8af30: 07 f9 f9 f9 f9 f9 f9 f9 07 f9 f9 f9 f9 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Contiguous container OOB:fc
  ASan internal:           fe
==25849==ABORTING

10 years agobabl_parse_double: permit 0 and 9 after .
Øyvind Kolås [Sun, 21 Jun 2015 20:25:41 +0000 (22:25 +0200)]
babl_parse_double: permit 0 and 9 after .

spotted by massimo, before this fix BABL_TOLERANCE < 0.1 and != 0 was not
possible.

10 years agoRevert "build: add --enable-installed-tests parameter"
Øyvind Kolås [Fri, 29 May 2015 03:05:32 +0000 (05:05 +0200)]
Revert "build: add --enable-installed-tests parameter"

This reverts commit 1457ff4d59f1e2fccdf7e09e5725a698afbc5d22.

10 years agoFix generation of test pixels
Loren Merritt [Fri, 29 May 2015 00:37:26 +0000 (00:37 +0000)]
Fix generation of test pixels

Most of the test data was zeros. Which produced innacurate benchmarks of any
conversion paths whose speed is data-dependent, such as gamma correction.

10 years agobuild: add --enable-installed-tests parameter
Vadim Rutkovsky [Thu, 7 Aug 2014 15:39:57 +0000 (17:39 +0200)]
build: add --enable-installed-tests parameter

See https://live.gnome.org/GnomeGoals/InstalledTests for more information.
Those tests will also be executed on http://build.gnome.org

It's still possible to run `make check` with locally uninstalled tests.

10 years agoCIE: minor cleanups
Thomas Manni [Wed, 20 May 2015 23:33:54 +0000 (01:33 +0200)]
CIE: minor cleanups

Use macros for kappa, epsilon and D50 reference white in all places
Remove duplicated comments

10 years agoCIE: new conversions to/from "CIE Lab alpha float" and "RGBA float"
Thomas Manni [Wed, 20 May 2015 10:12:35 +0000 (12:12 +0200)]
CIE: new conversions to/from "CIE Lab alpha float" and "RGBA float"

10 years agoDon't create a mutexattr for each mutex
Mukund Sivaraman [Wed, 22 Apr 2015 08:10:06 +0000 (13:40 +0530)]
Don't create a mutexattr for each mutex

10 years agoDon't repeat the malloc/free function pointer change messages
Mukund Sivaraman [Sun, 19 Apr 2015 19:30:58 +0000 (01:00 +0530)]
Don't repeat the malloc/free function pointer change messages

10 years agoRemove unnecessary stat()
Mukund Sivaraman [Sun, 12 Apr 2015 15:17:18 +0000 (20:47 +0530)]
Remove unnecessary stat()

10 years agobabl-mutex: Local headers first, remove unused
Jon Nordby [Wed, 18 Mar 2015 15:19:24 +0000 (16:19 +0100)]
babl-mutex: Local headers first, remove unused

Ensures the feature macros are set for all includes,
and that the public header does not implicitly rely
on any of the headers included in .c file